package com.carolouvindam.database;


public abstract class OrderTable {
    public static final String TABLESNAME = "order_table";
    public static final String ID = "_id";
    public static final String CLIENT_NAME = "name";
    public static final String CLIENT_FIRSTNAME = "firstname";
    public static final String CLIENT_PHONE = "phone";
    public static final String DATE = "date";
    public static final String ADDRESS_LINE1 = "line1";
    public static final String ADDRESS_LINE2 = "line2";
    public static final String ADDRESS_CITY = "city";
    public static final String ADDRESS_POSTALCODE = "postalcode";

    public static final String[] ALLFIELDS = new String[]{
            ID,
            CLIENT_NAME,
            CLIENT_FIRSTNAME,
            CLIENT_PHONE,
            DATE,
            ADDRESS_LINE1,
            ADDRESS_LINE2,
            ADDRESS_CITY,
            ADDRESS_POSTALCODE
    };

    public static final String CREATE = "CREATE TABLE " + TABLESNAME
            + " ( "
            + ID + " INTEGER PRIMARY KEY AUTOINCREMENT , "
            + CLIENT_NAME + " TEXT , "
            + CLIENT_FIRSTNAME + " TEXT , "
            + CLIENT_PHONE + " TEXT , "
            + DATE + " TIMESTAMP NOT NULL DEFAULT current_timestamp, "
            + ADDRESS_LINE1 + " TEXT , "
            + ADDRESS_LINE2 + " TEXT , "
            + ADDRESS_CITY + " TEXT , "
            + ADDRESS_POSTALCODE + " TEXT ); ";
}
